

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <!-- 标题 -->
    <title>重置密码</title>
    <!-- 关键词 -->
    <meta name="keywords" content="" />
    <!-- 网站简介 -->
    <meta name="description" content="" />
    <!-- 自适应屏幕 -->
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <!-- IE兼容 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 最新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="Content/bootstrap.min.css">
    <!-- 核心 CSS 文件 -->
    <link rel="stylesheet" href="Content/style.css" type="text/css">

    <script src="scripts/jquery-1.9.1.min.js"></script>
    <script src="scripts/bootstrap.min.js"></script>
    <script src="scripts/Dialog.js"></script>
    <link rel="stylesheet" href="Content/weui.css" />
    <script src="scripts/LodopFuncs.js"></script>


</head>
<body>
        <div class="index">
        <div class="index-top">
            外婆家1号
        </div>
        <div class="index-center">
            <div class="row">
                <div class="col-sm-2">
                    <div class="index-nav">
                            <p class="lastuser">还没有员工操作过</p>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="index-nav nav-home">
                        <a href="/System/RestIndex" class="active">首页</a>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="index-nav nav-home">
                        <a href="/System/SetPrint">设置打印机</a>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="index-nav nav-home">
                        <a href="/System/ResetPwd">修改密码</a>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="index-nav nav-home nav-pad">
                        
                        <a href="/System/SelPad"><span>2</span>切换PAD</a>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="index-nav nav-home">
                        <a href="/">退出登录</a>
                    </div>
                </div>
            </div>
        </div>
        </div>

    <div class="container reset-pwd">
        <div class="row">
            <div class="col-sm-4 text-right">
                员工编号
            </div>
            <div class="col-sm-4 text-left">
                <input id="waiterid" type="text" placeholder="请输入员工编号" />
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4 text-right">
                旧密码
            </div>
            <div class="col-sm-4 text-left">
                <input id="oldpwd" type="password" placeholder="请输入旧密码" />
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4 text-right">
                新密码
            </div>
            <div class="col-sm-4 text-left">
                <input id="newpwd" type="password" placeholder="请输入新密码" />
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4 text-right">
                确认密码
            </div>
            <div class="col-sm-4 text-left">
                <input id="confirmnewpwd" type="password" placeholder="再输入一次新密码" />
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4 text-right">
                
            </div>
            <div class="col-sm-4 text-left">
               <a href="#" class="weui_btn weui_btn_mini weui_btn_primary" onclick="Updatepwd()">确认</a>
            </div>
        </div>
    </div>

        <script type="text/javascript">
            function Updatepwd() {
                var formParam = {
                    waiter_id: $("#waiterid").val(),
                    oldPassword: $("#oldpwd").val(),
                    newPassword: $("#newpwd").val(),
                    confirmpwd: $("#confirmnewpwd").val()
                };
                $.ajax({
                    type: 'post',
                    url: '/System/Updatepwd',
                    data: formParam,
                    cache: false,
                    dataType: 'json',
                    success: function (data) {
                        if (data.success == true) {
                            WinAlert("密码修改成功", success);
                        } else {
                            WinAlert(data.message);
                        }
                    },
                    error: function () {
                        WinAlert("系统异常");
                    }
                });
            }

            function success() {
                window.location.href = "/system/restindex";
            }
    </script>

</body>
</html>

